"""
__author__ = 'heyanmin'
__time__ = '2021/8/7 9:35 下午'
"""
class Solution:
    #s 是字符串
    def length(self,s:str):
        list = []
        count = []
        if len(s) == 0:
            return 0
        for i in s:
            if i not in list:
                list.append(i)
            else:
                x = list.index(i)
                list = list[x+1:]
                list.append(i)
            count.append(len(list))
        return max(count),list

if __name__ == "__main__":
    s = 'abcacde'
    so = Solution()
    print(so.length(s))
